// 普通搜索
GET /goods/_search
{
    "query": {
        "bool": {
            "filter": [
                {
                    "match_all": {}
                },
                {
                    "terms": {
                        "cateId": [
                            "335",
                            "336"
                        ]
                    }
                }
            ]
        }
    }
}


GET _search/template
{
    "source": "{\"query\":{\"bool\":{\"filter\":[{\"match_all\":{}}{{#cateId}},{\"term\":{\"cateId\":\"{{cateId}}\"}}{{/cateId}}{{#brandId}},{\"term\":{\"brandId\":\"{{brandId}}\"}}{{/brandId}}]}}}",
    "params": {
      "cateId": 335,
      "brandId": 220
    }
}

POST _scripts/sku_search
{
  "script": {
    "lang": "mustache",
    "source": "{\"query\":{\"bool\":{\"filter\":[{\"match_all\":{}}{{#cateId}},{\"term\":{\"cateId\":\"{{cateId}}\"}}{{/cateId}}{{#brandId}},{\"term\":{\"brandId\":\"{{brandId}}\"}}{{/brandId}}]}}}"
  }
}

GET _scripts/sku_search

GET _search/template
{
    "id": "sku_search",
    "params": {
        "cateId": 335,
        "brandId": 220
    }
}

GET _search/template
{
  "id": "sku_search",
  "params": {
      "cateId": 335
    }
}